package com.example.demo.controller;

import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import org.springframework.web.servlet.ModelAndView;

@RestController
@RequestMapping(value = "/view")
public class ViewController {

    @RequestMapping(value = "/hello")
    public ModelAndView hello(){
        ModelAndView view = new ModelAndView();
        view.setViewName("hello");
        view.addObject("name","小五");
        return  view;
    }


}
